package com.mew.chess.core.game.shbz.game.message.request;

import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;


@Data
@ToString
@NoArgsConstructor
public class HitRequestMessage extends ZebraBaseMessage<HitRequestMessage> {

    private int bulletId; //子弹ID
    private int bulletType; //子弹类型
    private int betId; //押注ID
    private int isDouble;
    private int fishId; //鱼ID
    private int seatId; //位ID


    @Override
    public void write(ByteBuf b) {
        writeInt(b, this.bulletId);
        writeInt(b, this.bulletType);
        writeInt(b, this.betId);
        writeInt(b, this.isDouble);
        writeInt(b, this.fishId);
        writeInt(b, this.seatId);
    }

    @Override
    public HitRequestMessage read(ByteBuf b) {
        HitRequestMessage message = new HitRequestMessage();
        message.bulletId = readInt(b);
        message.bulletType = readInt(b);
        message.betId = readInt(b);
        message.isDouble = readInt(b);
        message.fishId = readInt(b);
        message.seatId = readInt(b);
        return message;
    }

}
